﻿
namespace GX
{
    static public class EventManager
    {
        static IEventManager _mgr;
        static IEventManager mgr
        {
            get
            {
                if (null == _mgr)
                    _mgr = App.GetService(App.SERVICE_EVENT_MANAGER) as IEventManager;
                return _mgr;
            }
        }
        static public void AddEvent(int eventID, EventDelegate del)
        {
            mgr.AddEvent(eventID,del);
        }
        static public void RemoveEvent(int eventID, EventDelegate del)
        {
            mgr.RemoveEvent(eventID, del);
        }
        static public void SendEvent(int eventID, object body = null)
        {
            mgr.SendEvent(eventID, body);
        }
        static public void PostEvent(int eventID, object body = null)
        {
            mgr.PostEvent(eventID, body);
        }
    }
}
